package com.share.ai.spring.functioncall;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Description;
import org.springframework.stereotype.Component;

import java.util.function.Function;

@Slf4j
@Component
@Description("某个地方有多少名字")
public class MyFunctionCall implements Function<MyFunctionCall.Request, MyFunctionCall.Respone> {

    /**
     * ai 会自动调用这个方法,并把需要的参数提取到 Request中
     *
     * @param request ai提取到的参数
     * @return
     */
    @Override
    public Respone apply(Request request) {
        log.info("ai 会自动调用这个方法,这里写具体的业务");
        return new Respone("处理完毕");
    }

    public record Request(String location, String name) {

    }

    public record Respone(String respone) {
    }
}
